import store from "../store"

// 累加的action
export const incrementAction = (data) => {
    return {
        type: 'incrementCount',
        data
    }
}

// 累减的action
export const decrementAction = (data) => {
    return {
        type: 'decrementCount',
        data
    }
}

// 异步函数的action
export const waitIncrementAction = (data) => {
    return () => {
        setTimeout(() => {
            store.dispatch({
                type: 'decrementCount',
                data
            })
        }, 2000)
    }
}